<?php 
require_once("..\Connections\mlu.php");
	  $insertSQL = "select * from clienti where cognome =";
	  $insertSQL=$insertSQL.$_GET['cognome']." and nome= ";
	  $insertSQL=$insertSQL.$_GET['nome'];
	  $Result1 = mysql_query($insertSQL, $mlu) or die(mysql_error());
	  $tot=mysql_num_rows($Result1);
	  if ($tot==0)	
	  {
		$insertSQL = "INSERT INTO clienti (Cognome, Nome, Indirizzo, City, provincia, Telcasa, TelCellu,mail) VALUES (";
  	  	$insertSQL=$insertSQL.$_GET['cognome'].",";
  	  	$insertSQL=$insertSQL.$_GET['nome'].",";
  	  	$insertSQL=$insertSQL.$_GET['ind'].",";
  	  	$insertSQL=$insertSQL.$_GET['city'].",";
	  	$insertSQL=$insertSQL.$_GET['provincia'].",";
	  	$insertSQL=$insertSQL.$_GET['telcasa'].",";
	  	$insertSQL=$insertSQL.$_GET['telcellu'].",";
	  	$insertSQL=$insertSQL.$_GET['mail'].")";
	  	$Result1 = mysql_query($insertSQL, $mlu) or die(mysql_error());
	  	$insertSQL = "select * from clienti where cognome =";
	  	$insertSQL=$insertSQL.$_GET['cognome']." and nome= ";
	  	$insertSQL=$insertSQL.$_GET['nome'];
	  	$Result1 = mysql_query($insertSQL, $mlu) or die(mysql_error());
		echo "<h1>Cliente inserito correttamente</h1>";
	  }
	  $row_Result1 = mysql_fetch_assoc($Result1);
	  $idcliente=$row_Result1['ID'];  ?>
  <script type="text/javascript">    
  	var jrole="ricezione/newbook.php?idcliente=<?php echo $idcliente; ?>";
      $('#index').delay(2000).slideUp(1000,function(){$('#index').load(jrole,'',$('#index').slideDown(1000))});
	  </script>
